package com.bluemedia.bookproject;

import com.bluemedia.bookproject.pages.BookEditPage;
import com.bluemedia.bookproject.pages.SimpleNextPage;
import com.bluemedia.bookproject.pages.TextFieldSample;
import com.bluemedia.bookproject.template.BookprojectHeaderFooterLevelWindow;
import com.bluemedia.stuff.UserBookProject;
import org.vaadin.appfoundation.authentication.util.AuthenticationUtil;
import org.vaadin.appfoundation.authorization.Permissions;
import org.vaadin.appfoundation.authorization.Resource;
import org.vaadin.appfoundation.authorization.memory.MemoryPermissionManager;
import org.vaadin.navigator7.NavigableApplication;
import org.vaadin.navigator7.window.NavigableAppLevelWindow;

/**
 * Created by IntelliJ IDEA.
 * User: kaafaar
 * Date: 11.04.11
 * Time: 22:02
 * To change this template use File | Settings | File Templates.
 */
public class BookprojectApplication extends NavigableApplication {

    @Override
    public NavigableAppLevelWindow createNewNavigableAppLevelWindow() {
        return new BookprojectHeaderFooterLevelWindow();
    }

    @Override
    public void init() {
        super.init();

        System.out.println("init aplikacji");

        UserBookProject user = new UserBookProject("test");

        Permissions.initialize(this, new MemoryPermissionManager());

        //Permissions.denyAll(user, );

//        try {
//            AuthenticationUtil.authenticate("test", "test");
//        }
//        catch(Exception e) {
//            e.printStackTrace();
//        }
    }

    public BookprojectApplication() {
        System.out.println("kontruktor");
    }
}